home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / MonitorIT 5.2.06 / monitorit_fullsetup.exe / data1.cab / Js / ViewReportFunc.js < prev    next >
Encoding:
JavaScript  |  2003-06-24  |  35.7 KB  |  1,012 lines

  1. /* ======================================================================
  2. DESC: Common Report Functions for the Administer Operations
  3.  
  4. PLATFORMS: >= MS IE 4.0
  5.  
  6. USAGE NOTES: 
  7. ====================================================================== */
  8. var SCbsy = false;
  9. var PuPW = "400px", PuPWu=400, PuPH = "130px", PuPHu=270, PuPCH = "235px";
  10. function processSizeChange() {
  11.     if ( SCbsy ) 
  12.         return;
  13.     SCbsy = true;
  14.     // Display Height and Width
  15.     bCh = document.body.clientHeight;
  16.     bCw = document.body.clientWidth;
  17.     
  18.     // Minimums
  19.     bCh = (bCh < bdH+byM+240) ? bdH+byM+240 : bCh;
  20.     bCw = (bCw < 330) ? 330 : bCw;
  21.    document.body.scroll = (bCw <= 330 || bCh <= bdH+byM+240) ? "yes" : "no";
  22.    
  23.    // PopUp 
  24.    PuPLeft = (bCw-PuPWu)/2;
  25.    PuPTop = (bCh-PuPHu)/2;
  26.    PopUpDiv.style.left = PuPLeft+"px"; 
  27.    PopUpDiv.style.top = "85px"; //PuPTop+"px"; 
  28.    PopUpDiv.style.height = PuPH;
  29.    PopUpDiv.style.width = PuPW;
  30.  
  31.    PuPLeft = (bCw-530)/2;
  32.    PuPTop = (bCh-450)/2;
  33.    PopUpNew.style.left = PuPLeft+"px"; 
  34.    PopUpNew.style.top = "5px"; //PuPTop+"px"; 
  35.    PopUpNew.style.height = "450px";
  36.    PopUpNew.style.width = "530px";
  37.  
  38.    PuPLeft = (bCw-400)/2;
  39.    PopUpExclude.style.left = PuPLeft+"px"; 
  40.    PopUpExclude.style.top = "5px"; //PuPTop+"px"; 
  41.    PopUpExclude.style.height = "450px";
  42.    PopUpExclude.style.width = "400px";
  43.  
  44.     //PopUpContext Menu
  45.    PopUpContextSize(bCw);
  46.   
  47.    // Set Height/Widths for Chart and Button areas
  48.     GTabBx.style.height = bCh-(bdH+byM-borderSz)-10;
  49.     GTabBx.style.width = bCw-byM-12;
  50.     GTab.style.top = bCh-(bdH+byM-borderSz)-90;
  51.     ResultsRUI.style.height = SchedRUI.style.height = GTabBx.style.posHeight-TitleDivSize;
  52.     ResultsRUI.style.width = SchedRUI.style.width = GTab.style.width = GTabBx.style.posWidth-28;
  53.     ResultRwin1.style.height = SchedRwin.style.height = SchedRUI.style.posHeight-TitleDivSize-15;
  54.     ResultRwin1.style.width = SchedRwin.style.width = SchedRUI.style.posWidth-15;
  55.     GTabBx.style.display = "";
  56.     
  57.     // PopUp 
  58.     PupSLeft = (bCw <= 500) ? 0 : (bCw-500)/2;
  59.    PopUpSelectDiv.style.left = PupSLeft+"px"; 
  60.    PopUpSelectDiv.style.top = "40px"; //PuPTop+"px"; 
  61.    PopUpSelectDiv.style.height = GTabBx.style.posHeight-60;
  62.    PopUpSelectDiv.style.width = "500px";
  63.    AL_CCOneAlertGroup.style.height = GTabBx.style.posHeight-120;
  64.  
  65.     SchedReportTab.className="STabUnsel";
  66.     ResultsReportTab.className="STabUnsel";
  67.     document.all[CurSelTab].className="STabSel";
  68.    if ( SrsObjArr.length == 0 && CurSelTab == "SchedReportTab") {
  69.         outputReportsStatusTextBox();
  70.     }
  71.     SCbsy = false;
  72. }
  73.  
  74. /* Initiate Lookup of Currently Scheduled Reports */ 
  75. function processVRLookupReset() {
  76.     SrsObjArr.length = 0;
  77.     SchedRwin.innerHTML = ""; //clear display before clearing store
  78.     SchedRptLupRecCount = 0; // clear Lookup record counter
  79.     if ( RpmCC_VR.WSHLookupName("*") ) {
  80.         VRMode = "";
  81.         top.Rstatus.Pstat("Unable to start the SCHEDULED REPORT LOOKUP request",true);
  82.     }
  83.     else {
  84.         VRMode = "LookupSchedReport"; // set Mode of operation
  85.         top.Rstatus.Pstat("One moment while SCHEDULED REPORT LOOKUP request completes");
  86.           SetCursor("wait");
  87.           top.banner.processStartComm();
  88.     }
  89. }
  90.  
  91. /* Process WSH Add Op Complete */
  92. function processWSHOpComplete() {
  93.     if (VRMode == "LookupSchedReport") {
  94.         VRMode = ""; // reset
  95.         if (SchedRptLupRecCount == 0) { // check if any records found
  96.             top.Rstatus.Pstat("No record matches found for SCHEDULED REPORT LOOKUP request",true);
  97.         }
  98.         else {
  99.             top.Rstatus.Pstat("Request Completed");
  100.             if ( DeleteSpecialReports == true ) { // if flag to delete any "Inventory" report results
  101.                 DeleteSpecialReports = false; // reset                
  102.                 for ( var i=0; i<SrsObjArr.length; i+=SchedReportRecLength ) {
  103.                     // if special "Inventory" report and Report results exists
  104.                     if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 && SrsObjArr[i+12] == AComplete) { 
  105.                         SrsObjArr[i+12] = ANotStarted; // Set Started State
  106.                         wshid = SrsObjArr[i+0]; // get Report ID    
  107.                         RpmCC_VR.WSHDeleteHTML(wshid); // Delete existing Analysis report first
  108.                      }
  109.                  }
  110.             }
  111.         }
  112.         outputReportsStatusTextBox();
  113.         if ( ComServcsLookupRqd ) {
  114.             ComServcsLookupRqd = false;
  115.             AlertLupRecCount = 0; // clear Lookup record counter
  116.             AlertRec_Arr.length = 0; // clear
  117.             if ( RpmCC_VR.AlertGroupLookup("*") ) {
  118.                 top.Rstatus.Pstat("Unable to start the Alert LOOKUP request",true);
  119.                 CursorReset();
  120.             }
  121.             else {
  122.                 top.Rstatus.Pstat("One moment while Alert LOOKUP request completes");
  123.             }
  124.         }
  125.         else {
  126.             CursorReset();
  127.         }
  128.     }
  129.     else if ( VRMode == "RemoveSchedReport" ) {
  130.         if ( --DeleteCount <= 0 )                   
  131.                 outputReportsStatusTextBox(); // go redisplay
  132.         checkEnableDisable();                
  133.     }
  134.     else {
  135.         top.Rstatus.Pstat("Request Completed");
  136.     }
  137. }
  138.  
  139. function CursorReset() {
  140.       SetCursor("auto");
  141.     top.banner.processStopCommX();
  142. }
  143. function CursorWait() {
  144.     SetCursor("wait");
  145.     top.banner.processStartComm();
  146. }
  147.  
  148. // Alert Lookup Record
  149. var AlertRecLength = 5;
  150. var AlertLupRecCount = 0;
  151. function processAlertLupRec(AlID, AlName, AlDesc, AlSDT) {
  152.     var i = AlertLupRecCount * AlertRecLength;
  153.     var CurrentAlertType = "C"; // set Counter type
  154.     
  155.     if ( AlSDT == "01/01/1999 11:50:00" || AlSDT == "1/1/1999 11:50:0" ) { // if User
  156.         CurrentAlertType = "U"; // "User" type
  157.     }
  158.     else if ( AlSDT == "01/01/1999 11:40:00" || AlSDT == "1/1/1999 11:40:0" ) { 
  159.         CurrentAlertType = "E"; // "Event Log" type
  160.     }
  161.     else if ( AlSDT == "01/01/1999 11:20:00" || AlSDT == "1/1/1999 11:20:0" ) { 
  162.         CurrentAlertType = "T"; // "SNMP Trap" type
  163.     }
  164.     else if ( AlSDT == "01/01/1999 11:10:00" || AlSDT == "1/1/1999 11:10:0" ) { 
  165.         CurrentAlertType = "W"; // "Win Service" type
  166.     }
  167.     else if ( AlSDT == "01/01/1999 11:00:00" || AlSDT == "1/1/1999 11:0:0" ) { 
  168.         CurrentAlertType = "F"; // "File Check" type
  169.     }
  170.     else if ( AlSDT == "01/01/1999 11:12:00" || AlSDT == "1/1/1999 11:12:0" ) { 
  171.         CurrentAlertType = "P"; // "Process Check" type
  172.     }
  173.     else if ( AlSDT == "01/01/1999 11:15:00" || AlSDT == "1/1/1999 11:15:0" ) { 
  174.         CurrentAlertType = "L"; // "SYSLOG Check" type
  175.     }
  176.     else if ( AlSDT == "01/01/1999 11:30:00" || AlSDT == "1/1/1999 11:30:0" ) { // Service type
  177.         CurrentAlertType = "S"; // "Service" type
  178.     }
  179.     else // ignore
  180.         return;
  181.  
  182.     // Parse Out Dependency, MaxAlerts etc.
  183.     var warr = new Array();
  184.     warr = AlDesc.split("[]");
  185.     AlDesc = warr[0];
  186.  
  187.     AlertRec_Arr[i++] = AlID;
  188.     AlertRec_Arr[i++] = AlName;
  189.     AlertRec_Arr[i++] = AlDesc;
  190.     AlertRec_Arr[i++] = CurrentAlertType;
  191.     AlertRec_Arr[i] = 0;
  192.     ++AlertLupRecCount;
  193. }
  194.  
  195. /* Alert Lookup Op Complete */
  196. function processAlertOpComplete() {
  197.     if (AlertLupRecCount == 0) { // check if any records found
  198.          top.Rstatus.Pstat("No record matches found for Watch/Alert LOOKUP request",true);    
  199.         CursorReset();
  200.      }
  201.      else {
  202.         // Do Services Lookup
  203.         ServicesRecCount = 0; // reset count
  204.         Services_Arr.length = 0;
  205.         rstat = RpmCC_VR.ServicesLookup("","","ComputerID,ID DESC");    
  206.         if ( rstat ) { // if unable to initiate request    
  207.             top.Rstatus.Pstat("Unable to start the Services LOOKUP request",true);
  208.             CursorReset();
  209.         }
  210.         else { // waiting for OperationCompleteEvent
  211.             top.Rstatus.Pstat("One moment while Services LOOKUP request completes");
  212.             return;
  213.         }
  214.      }
  215. }
  216. function processAlertOpError() {
  217.     top.Rstatus.Pstat("Error in Watch/Alert Lookup");
  218. }
  219.  
  220. // Process Serverices LOOKUP Record Event
  221. var ServicesRecCount = 0;
  222. var ServicesRecLength = 4; // Services Lookup record length
  223. function processServicesRecord(SRVstrg) {
  224.     var warr = new Array();
  225.     warr = SRVstrg.split("~");
  226.     var j = ServicesRecCount * ServicesRecLength;
  227.      Services_Arr[j] = warr[1]; // Computer ID
  228.       Services_Arr[j+1] = warr[2]; // AlertGroup ID
  229.       warr[3] = (warr[3] == "SQLCONNECT") ? "SQL" : warr[3];
  230.       Services_Arr[j+2] = warr[3]; // Type
  231.       Services_Arr[j+3] = SRVstrg; 
  232.     ++ServicesRecCount; // bump record counter    
  233. }
  234.  
  235. // Process Services Operation Complete Event
  236. function processServicesOpComplete() {
  237. // Initiate Computer Lookup
  238.     CompRecCount = 0; // initialize the count
  239.     AC_CompStoreArr.length = 0;
  240.     if ( RpmCC_VR.ComputerLookup("*","*") ) {
  241.         top.Rstatus.Pstat("Unable to start the Computer LOOKUP request",true);
  242.         CursorReset();
  243.     }
  244.     else { // waiting for OperationCompleteEvent
  245.         top.Rstatus.Pstat("One moment while Computer LOOKUP request completes");
  246.     }
  247. }
  248. function processServicesOpError() {
  249.     top.Rstatus.Pstat("Error in IP Services Lookup");
  250. }
  251.  
  252. var CompRecLength = 5;
  253. var CompRecCount = 0;
  254. function processCompAddToStore(CNme,CDesc,Cid,Gid) {
  255.     var i = CompRecCount * CompRecLength;
  256.     AC_CompStoreArr[i++] = Cid; 
  257.     AC_CompStoreArr[i++] = Gid; 
  258.     AC_CompStoreArr[i++] = CNme; 
  259.     AC_CompStoreArr[i++] = CDesc; 
  260.     AC_CompStoreArr[i++] = "0"; // "S"
  261.     ++CompRecCount;
  262. }
  263. function processComputerLookupComplete() {
  264. // Initiate SyslogCheck Lookup
  265.     SyslogCheck_Arr.length = 0;
  266.     if ( RpmCC_VR.SyslogCheckLookup("*") ) {
  267.         top.Rstatus.Pstat("Unable to start the SYSLOGWatch lookup request",true);
  268.         CursorReset();
  269.     }
  270.     else {
  271.         top.Rstatus.Pstat("One moment while SYSLOGWatch lookup request completes");
  272.     }
  273. }
  274. function processComputerOpError() {
  275.     top.Rstatus.Pstat("Error in Server/Computer Lookup");
  276. }
  277.  
  278. var SyslogCheck_Arr = new Array();
  279. var SyslogCheckRecLength = 2;
  280. function processSLLookupOpComplete(SLLStat) {
  281.     var wrkarr = new Array();
  282.     wrkarr = SLLStat.split(":"); // parse the lookup record
  283.     if ( wrkarr[0] != "Err" ) {
  284.         SyslogCheck_Arr = SLLStat.split("~"); // parse the lookup record
  285.     }
  286.     // Get Process Check Watches
  287.     ProcessCheck_Arr.length = 0;
  288.     if ( RpmCC_VR.ProcessCheckLookup("*") ) {
  289.         top.Rstatus.Pstat("Unable to start the ProcessWatch lookup request",true);
  290.         CursorReset();
  291.     }
  292.     else {
  293.         top.Rstatus.Pstat("One moment while ProcessWatch lookup request completes");
  294.     }
  295. }
  296. var ProcessCheck_Arr = new Array();
  297. var ProcessCheckRecLength = 2;
  298. function processPCLookupOpComplete(FCLStat) {
  299.     var wrkarr = new Array();
  300.     wrkarr = FCLStat.split(":"); // parse the lookup record
  301.     if ( wrkarr[0] != "Err" ) {
  302.         ProcessCheck_Arr = FCLStat.split("~"); // parse the lookup record
  303.     }
  304.     // Get File Check Watches
  305.     FileCheck_Arr.length = 0;
  306.     if ( RpmCC_VR.FileCheckLookup("*") ) {
  307.         top.Rstatus.Pstat("Unable to start the FileWatch lookup request",true);
  308.         CursorReset();
  309.     }
  310.     else {
  311.         top.Rstatus.Pstat("One moment while FileWatch lookup request completes");
  312.     }
  313. }
  314. var FileCheck_Arr = new Array();
  315. var FileCheckRecLength = 2;
  316. function processFCLookupOpComplete(FCLStat) {
  317.     var wrkarr = new Array();
  318.     wrkarr = FCLStat.split(":"); // parse the lookup record
  319.     if ( wrkarr[0] != "Err" ) {
  320.         FileCheck_Arr = FCLStat.split("~"); // parse the lookup record
  321.     }
  322.     // Get Win Services Watches
  323.     WinSCheck_Arr.length = 0;
  324.     if ( RpmCC_VR.NTServicesMonitorLookupAGID("*") ) {
  325.         top.Rstatus.Pstat("Unable to start the WinServicesWatch lookup request",true);
  326.         CursorReset();
  327.     }
  328.     else {
  329.         top.Rstatus.Pstat("One moment while WinServicesWatch lookup request completes");
  330.     }
  331. }
  332. var WinSCheck_Arr = new Array();
  333. var WinSCheckRecLength = 2;
  334. function processNTSMLookupOpComplete(NTSMLStat) {
  335.     var wrkarr = new Array();
  336.     wrkarr = NTSMLStat.split(":"); // parse the lookup record
  337.     if ( wrkarr[0] != "Err" ) {
  338.         WinSCheck_Arr = NTSMLStat.split("~"); // parse the lookup record
  339.     }
  340.     // Get SNMP Trap Watches
  341.     SNMPCheck_Arr.length = 0;
  342.     if ( RpmCC_VR.SnmpTrapMonitorFindByAGId("*") ) {
  343.         top.Rstatus.Pstat("Unable to start the SNMPTrapWatch lookup request",true);
  344.         CursorReset();
  345.     }
  346.     else {
  347.         top.Rstatus.Pstat("One moment while SNMPTrapWatch lookup request completes");
  348.     }
  349. }
  350. var SNMPCheck_Arr = new Array();
  351. var SNMPCheckRecLength = 2;
  352. function processSNMPLookupOpComplete(SNMPLStat) {
  353.     var wrkarr = new Array();
  354.     wrkarr = SNMPLStat.split(":"); // parse the lookup record
  355.     if ( wrkarr[0] != "Err" ) {
  356.         SNMPCheck_Arr = SNMPLStat.split("~"); // parse the lookup record
  357.     }
  358.     // Get Event Log Watches
  359.     EventLCheck_Arr.length = 0;
  360.     if ( RpmCC_VR.ELMonitorLookupByAlertGroup("*") ) {
  361.         top.Rstatus.Pstat("Unable to start the EventLogWatch lookup request",true);
  362.         CursorReset();
  363.     }
  364.     else {
  365.         top.Rstatus.Pstat("One moment while EventLogWatch lookup request completes");
  366.     }
  367. }
  368. var EventLCheck_Arr = new Array();
  369. var EventLCheckRecLength = 2;
  370. function processEVLookupOpComplete(EVLStat) {
  371.     var wrkarr = new Array();
  372.     wrkarr = EVLStat.split(":"); // parse the lookup record
  373.     if ( wrkarr[0] != "Err" ) {
  374.         EventLCheck_Arr = EVLStat.split("~"); // parse the lookup record
  375.     }
  376.     // Done Lookups
  377.     top.Rstatus.Pstat("Request Completed");
  378.     CursorReset();
  379. }
  380. function processELMonitorOpError() {
  381.     // Done Lookups
  382.     top.Rstatus.Pstat("Request Completed");
  383.     CursorReset();
  384. }
  385.  
  386. // Process Unsolicited Status Change Event for a Report
  387. function processWSHStatusChange(wsid,wsstat) {
  388.     if ( AnalysisBusy || wsstat == SHTMLDeleted) {
  389.         return; // ignore these for now
  390.     }
  391.     if (SchedRUI.style.display == "") { // if Schedule Report box displayed
  392.         var k=SrsObjArr.length; // length status display
  393.         for ( var i=0; i<SrsObjArr.length; i+=SchedReportRecLength ) {
  394.             if ( SrsObjArr[i] == wsid) { // match ID in store with Status Change event
  395.                 if ( wsstat == SDeleted ) {
  396.                     var idx = i; // index to record to be deleted
  397.                     for (var m = idx+SchedReportRecLength; m < SrsObjArr.length; ++m, ++idx) {
  398.                         SrsObjArr[idx] = SrsObjArr[m];
  399.                     }
  400.                     SrsObjArr.length -= SchedReportRecLength;
  401.                 }
  402.                  else if ( SrsObjArr[i+4] != wsstat) { // Status different
  403.                     SrsObjArr[i+4] = wsstat; // update status
  404.                     if (wsstat == SCompleted) {
  405.                        SrsObjArr[i+12] = ANotStarted;
  406.                    }    
  407.                }
  408.                 if ( wsstat == SDeleted ) {
  409.                     break;
  410.                     //if ( --DeleteCount > 0 ) break;
  411.                 }               
  412.                 outputReportsStatusTextBox(); // go redisplay
  413.                 break;
  414.             }
  415.         }
  416.         if ( i>=k ) { // if not found, must be new entry
  417.             top.Rstatus.Pstat("Unsolicited Report Status Change received");
  418.             processVRLookupReset(); // go lookup current schedule reports
  419.         }
  420.     }
  421. }
  422.  
  423. // Process Unsolicited Status Change Event for a ReportAnalysis being Generated
  424. function processAnalyzeStatusChange() {
  425.     if (SchedRUI.style.display == "") { // if Schedule Report box displayed
  426.        outputReportsStatusTextBox(); 
  427.     }
  428. }
  429.  
  430. /* Process Click on selected Tab */
  431. var CurSelTab = "SchedReportTab"; // current selected tab
  432. var RTid = null;
  433. function processGeneralClick(th) {
  434.     if ( th.style.cursor =="auto" ) 
  435.         return; // ignore disabled
  436.  
  437.     top.Rstatus.Pstat("");
  438.     SchedRUI.style.display="none";
  439.     ResultsRUI.style.display="none";
  440.     SchedReportTab.className="STabUnsel";
  441.     ResultsReportTab.className="STabUnsel";
  442.     th.className="STabSel";
  443.     CurSelTab = th.id;
  444.     switch ( th.id ) {
  445.    case "SchedReportTab" : 
  446.       SchedRUI.style.display=""; // Enable this Tab's view
  447.        outputReportsStatusTextBox(); 
  448.      break;
  449.    case "ResultsReportTab" : 
  450.         document.all.ResultIF1.src = ""; // clear report results
  451.         RTid = setTimeout("processRTab()",100); // Delay 100 ms. 
  452.      break;
  453.     }
  454. }
  455. function processRTab() {
  456.     RTid = null;
  457.    ResultsRUI.style.display=""; // Enable this Tab's view
  458.     processResultTabInit(); // Go set up Result windows
  459. }
  460.  
  461. // Initialize Result Tab windows
  462. var RptAr = new Array(); // Current Selected Report Array
  463. var RptIx = 0; // Current Selected Report Index
  464. function processResultTabInit() {
  465.     // Get all selected that are Completed
  466.     RptAr.length = 0; // reset Report array
  467.     RptIx = 0; // initialize index
  468.     var i=(-1), j=0;// initialize search
  469.     while ( (i = getNextSelected(i)) != -1 ) {
  470.         if ( SrsObjArr[i+12] == AComplete ) {
  471.             RptAr[j++] = SrsObjArr[i+10]; // get Report URL
  472.         }
  473.     }
  474.     // Check if at least one report
  475.     if ( j > 0 ) {
  476.         DisplayReport(); // go display first selected report
  477.     }
  478. }
  479.  
  480. // Display Specified Report from Selected Report Array
  481. function DisplayReport() {
  482.     document.all.ResultIF1.src = RptAr[RptIx]; // show report results
  483.     // Set Next and previous buttons accordingly
  484.     var nflg = (RptIx < RptAr.length-1) ? 1 : 0;
  485.     var pflg = (RptIx > 0) ? 1 : 0;
  486.     //RNextBut.className = (nflg) ? "SBoxButton" : "SBoxButtonD";
  487.     //RPrevBut.className = (pflg) ? "SBoxButton" : "SBoxButtonD";
  488.     RNextBut.disabled = (nflg) ? "" : "disabled";
  489.     RPrevBut.disabled = (pflg) ? "" : "disabled";
  490. }
  491.  
  492. // Process Next and Previous Report Results Buttons
  493. function processResultsNext() {
  494.     ++RptIx;  // bump to Next report
  495.     DisplayReport(); // go display it
  496. }
  497.  
  498. function processResultsPrevious() {
  499.     --RptIx;  // bump to Previous report
  500.     DisplayReport(); // go display it
  501. }
  502.  
  503. /* Update Scheduled report Status Box */
  504. var DisplayCount = 0;
  505. var RptCount = 0;
  506. var LineCount = 0;
  507. function outputReportsStatusTextBox() {
  508.     RptCount = 0;
  509.     LineCount = 0;    
  510.     CursorWait();    
  511.     outputReportsStatusTextBoxContinue();
  512. }
  513. function outputReportsStatusTextBoxContinue() {
  514.     Tid = null;
  515.     var sob = "";
  516.     var i = RptCount;
  517.     var j = LineCount;
  518.     var DtArr = new Array();
  519.     var DeArr = new Array();
  520.     var Parr = new Array();
  521.     var Narr = new Array();
  522.     spec_dt = "<font color='blue'>--------------</font>"; // D/T for "Inventory" reports
  523.  
  524.     if ( RptCount == 0 ) {
  525.         SchedRwin.innerHTML = ""; //clear display
  526.        sob = "<table border='0' cellpadding='0' cellSpacing='1' width='1100' id='table'>";
  527.         sob += "<tr><td width='25%' align='center' class='optextb' style='background-color:activeborder'>" + "Report Name" + "</td>";
  528.         sob += "<td width='10%' align='center' class='optextb' style='background-color:activeborder'>" + "Analysis Status" + "</td>";
  529.         sob += "<td width='7%' align='center' style='background-color:activeborder' class='optextb'>" + "Start Date" + "</td>";
  530.         sob += "<td width='6%' align='center' style='background-color:activeborder' class='optextb'>" + "Start Time" + "</td>";
  531.         sob += "<td width='7%' align='center' style='background-color:activeborder' class='optextb'>" + "End Date" + "</td>";
  532.         sob += "<td width='6%' align='center' style='background-color:activeborder' class='optextb'>" + "End Time" + "</td>";
  533.         sob += "<td width='39%' align='center' class='optextb' style='background-color:activeborder'>" + "Last Status Message" + "</td></tr>";
  534.     }
  535.     else {
  536.        sob = "<table border='0' cellpadding='0' cellSpacing='1' width='1100' id='table"+i+"'>";
  537.     }    
  538.                 
  539.     for (    var loopcount = 0; i<SrsObjArr.length && loopcount < 25; i+=SchedReportRecLength ) {
  540.         // Check if Show All or only the Completed
  541.         if ( ShowAllEnabled.checked == false && SrsObjArr[i+4] != SCompleted) {
  542.            continue;
  543.        }
  544.        // If show all enabled and Not "SCompleted"
  545.        if (SrsObjArr[i+4] == SScheduled)
  546.            SrsObjArr[i+12] = AMonSched;
  547.        else if (SrsObjArr[i+4] == SMonitor)
  548.            SrsObjArr[i+12] = AMonProc;
  549.        //else if (SrsObjArr[i+4] == SCompleted)
  550.        //    SrsObjArr[i+12] = ANotStarted;
  551.  
  552.         sob += "<tr style='cursor:hand' onclick='processRSClick(\"row" + i + "\")'";
  553.         if ( SrsObjArr[i+15] == 1 ) { // if selected
  554.            sob += " style='background-color:scrollbar' ";
  555.        }
  556.        else if ( j % 2  ) {
  557.            sob += " style='background-color:e8e8e8' ";
  558.         }
  559.        sob += ( j % 2  ) ? " rescol='e8e8e8' " : " rescol='white' ";
  560.  
  561.         sob += " ondblclick='processRSDblClick(\"row" + i +"\")' id='row" + i + "'>";
  562.         sob += "<td width='25%' class='optext' title='";        
  563.         sob += SrsObjArr[i+2] + "'";
  564.         if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report
  565.            sob += " style='color:blue' ";
  566.         }
  567.         
  568.     
  569.         var NApend = "";    
  570.         if ( SrsObjArr[i+9].length > 0 ) {
  571.             Parr = SrsObjArr[i+9].split("[]"); // Get Scedule Parameters
  572.             if ( Parr.length > 12 ) {
  573.                 Narr = Parr[12].split(":");
  574.                 NApend = "-"+Narr[0];
  575.             }
  576.         }        
  577.         sob += ">" + SrsObjArr[i+1] + NApend +  "</td>";
  578.  
  579.         sob += "<td width='10%' class='optext'";
  580.         if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report
  581.            sob += " style='color:blue' ";
  582.         }
  583.         sob += ">" + AnalyzeProcArray[SrsObjArr[i+12]] + "</td>";
  584.  
  585.         DtArr = SrsObjArr[i+7].split(" "); // Split out Start Date and Time
  586.         DeArr = DtArr[0].split("/"); // Split out m/d/y
  587.         d = (DeArr[0].length == 1) ? "0"+DeArr[0] : DeArr[0];
  588.         d += "/" + ((DeArr[1].length == 1) ? "0"+DeArr[1] : DeArr[1]);
  589.         d += "/" + ((DeArr[2].length == 1) ? "0"+DeArr[2] : DeArr[2]);
  590.         if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report
  591.             d = spec_dt;
  592.         }
  593.         sob += "<td width='7%' class='optext'>" + d + "</td>";
  594.         DeArr = DtArr[1].split(":"); // Split out h:m:s
  595.         d = (DeArr[0].length == 1) ? "0"+DeArr[0] : DeArr[0];
  596.         d += ":" + ((DeArr[1].length == 1) ? "0"+DeArr[1] : DeArr[1]);
  597.         d += ":" + ((DeArr[2].length == 1) ? "0"+DeArr[2] : DeArr[2]);
  598.         if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report
  599.             d = spec_dt;
  600.         }
  601.         sob += "<td width='6%' class='optext'>" + d + "</td>";
  602.         
  603.         DtArr = SrsObjArr[i+8].split(" "); // Split out End Date and Time
  604.         DeArr = DtArr[0].split("/"); // Split out m/d/y
  605.         d = (DeArr[0].length == 1) ? "0"+DeArr[0] : DeArr[0];
  606.         d += "/" + ((DeArr[1].length == 1) ? "0"+DeArr[1] : DeArr[1]);
  607.         d += "/" + ((DeArr[2].length == 1) ? "0"+DeArr[2] : DeArr[2]);
  608.         if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report
  609.             d = spec_dt;
  610.         }
  611.         sob += "<td width='7%' class='optext'>" + d + "</td>";
  612.         DeArr = DtArr[1].split(":"); // Split out h:m:s
  613.         d = (DeArr[0].length == 1) ? "0"+DeArr[0] : DeArr[0];
  614.         d += ":" + ((DeArr[1].length == 1) ? "0"+DeArr[1] : DeArr[1]);
  615.         d += ":" + ((DeArr[2].length == 1) ? "0"+DeArr[2] : DeArr[2]);
  616.         if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report
  617.             d = spec_dt;
  618.         }
  619.         sob += "<td width='6%' class='optext'>" + d + "</td>";
  620.  
  621.         sob += "<td width='39%' class='optext'";
  622.         if ( SrsObjArr[i+14] == 1 ) { // if last message is error
  623.             sob += " style='color:red'"; // highlight in red
  624.         }
  625.         else if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report
  626.            sob += " style='color:blue'";
  627.         }
  628.         sob += ">" + SrsObjArr[i+13] + "</td></tr>";
  629.         ++j;
  630.         ++loopcount;
  631.    }
  632.    DisplayCount = j;
  633.    if ( SrsObjArr.length == 0 ) {
  634.          sob += "<tr><td colspan='7' width='"+ ResultsRUI.style.posWidth + "' align='center' style='color:red' class='optextn'>" + "No Reports Found" + "</td></tr>";
  635.     }
  636.     sob += "</table>";
  637.     SchedRwin.insertAdjacentHTML("beforeEnd",sob);
  638.     checkEnableDisable(); // check buttons and result tab enable/disabled
  639.     RptCount = i;
  640.     LineCount = j;
  641.     if ( i < SrsObjArr.length ) { // continue if not done
  642.             Tid = setTimeout("outputReportsStatusTextBoxContinue()",50); // delay 50 ms. then continue           
  643.     }
  644.     else {
  645.         SetButtonState(RefreshButton,"0");
  646.         CursorReset();
  647.         top.Rstatus.Pstat("Request Completed");
  648.     }        
  649. }
  650.  
  651. // Process and Display the Group:Computer Tree
  652. var CCEs = null;
  653. var GroupExpandedCount = 0;
  654. var GroupDisplayedCount = 0;
  655. var LastGroupDisplayed = 0;
  656. var CurrentServiceDisplayed = "";
  657. function processAlertGroupTree() {
  658.     var tstrg = "Watch/Alert : Servers/Devices Tree";
  659.     if ( RPRtyp == "[2]" ) {
  660.         AllServersSelected1.checked = "checked";
  661.         AllServersSelected1.disabled = "disabled";    
  662.     }
  663.     else {
  664.         var ST = ServiceTypes[ServiceSelect.selectedIndex];
  665.         if ( ST == CurrentServiceDisplayed ) 
  666.             return;
  667.         CurrentServiceDisplayed = ST;            
  668.         AllServersSelected.checked = "checked";
  669.         AllServersSelected.disabled = "disabled";    
  670.     }    
  671.     CompSelectedArr = ""; 
  672.     var Op = AL_CCOneAlertGroup; // preset
  673.     Op.innerHTML = ""; // reset
  674.     setOutHeader(tstrg); // define output table header    
  675.     
  676.     for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) {
  677.         AC_CompStoreArr[j+4] = 0; // reset selected
  678.     }        
  679.  
  680.     /* Format and Output Service tree list */
  681.     GroupExpandedCount = 0; // init
  682.     GroupDisplayedCount = 0;
  683.     for ( var i=0; i<AlertLupRecCount; i++) {
  684.         if ( !checkIncludedWatch(i) ) {
  685.             continue;
  686.         }
  687.         CCEs += "<table border='0' cellpadding='0' cellSpacing='0' width='490'><tr title='"+ AlertRec_Arr[(i*AlertRecLength)+2] +"'><td width='25'> </td>";
  688.         Iprefx = ( i+1 >= AlertLupRecCount ) ? "L" : "T";
  689.           CCEs += "<td width='19' align='center'><img id='lima" + GroupDisplayedCount + "' expanded='0' src='images/" + Iprefx + "plus.gif' style='cursor:hand' onclick='procGrpImgClick(this)' width='19' height='20'></td>";
  690.         CCEs += "<td width='19' align='center'><img id='limb" + GroupDisplayedCount + "' src='images/CloseImg.gif' style='cursor:hand' onclick='procGrpImgClick(this)' width='15' height='14' ";
  691.         CCEs += "></td><td width='*' class='optext'>" + AlertRec_Arr[(i*AlertRecLength)+1] + "</td></tr></table>";
  692.         CCEs += "<div id='lexp" + GroupDisplayedCount + "' agix="+i+" compcount=0></div>";
  693.         LastGroupDisplayed = GroupDisplayedCount;
  694.         ++GroupDisplayedCount;
  695.       }
  696.       if ( GroupDisplayedCount == 0 ) {
  697.         CCEs += "<table border='0' cellpadding='0' cellSpacing='0' width='490'>";
  698.         CCEs += "<tr><td width='25'> </td>";
  699.         if ( RPRtyp == "[2]" ) {
  700.               CCEs += "<td width='19' height='20' align='center'></td><td colspan='2' width='*' class='optextb'>No Watches/Alerts defined for the selected Watch/Alert Types</td></tr></table>";
  701.         }
  702.         else {
  703.               CCEs += "<td width='19' height='20' align='center'></td><td colspan='2' width='*' class='optextb'>No Watches/Alerts defined for the IP Service: "+ST+" </td></tr></table>";
  704.         }
  705.     }
  706.     else {
  707.         if ( Iprefx == "T" ) {
  708.             var lindx = CCEs.lastIndexOf("Tplus");
  709.             if ( lindx != -1 ) {
  710.                 var eCCE = CCEs.substring(0, lindx);
  711.                 eCCE += "L";
  712.                 eCCE += CCEs.substring(lindx+1)
  713.                 CCEs = eCCE;
  714.             }
  715.         }
  716.     }
  717.     Op.insertAdjacentHTML("beforeEnd",CCEs);
  718. }
  719. function checkIncludedWatch(cindex) {
  720.     var i = cindex;
  721.     var CAT = AlertRec_Arr[(i*AlertRecLength)+3];
  722.     if ( RPRtyp == "[2]" ) {
  723.         if ((Report_SWA.checked && CAT == "S") ||
  724.               (Report_SNMP.checked && CAT == "T") ||
  725.                (Report_EL.checked && CAT == "E") ||
  726.                (Report_WS.checked && CAT == "W") ||
  727.                (Report_SL.checked && CAT == "L") ||
  728.                 (Report_PC.checked && CAT == "P") ||
  729.               (Report_FC.checked && CAT == "F") )
  730.                 return true;
  731.     }
  732.     else {    
  733.         if ( CAT == "S" && checkServiceType( AlertRec_Arr[(i*AlertRecLength)] ) )  // Service type
  734.             return true;
  735.     }
  736.     return false;
  737. }
  738. function checkServiceType(agid) {
  739.     var ST = ServiceTypes[ServiceSelect.selectedIndex];
  740.     for ( var i=0; i<Services_Arr.length; i+= ServicesRecLength ) {
  741.         if ( Services_Arr[i+1] == agid && Services_Arr[i+2] == ST ) {
  742.             return true;
  743.         }
  744.     }
  745.     return false;
  746. }
  747.  
  748. /* Display Header for Service and Object:Counter Trees */
  749. function setOutHeader(Tstrg) {
  750.     CCEs = "<table border='0' cellpadding='0' cellSpacing='0' width='490'>";
  751.     CCEs += "<tr><td width='25'> </td>";
  752.       CCEs += "<td width='19' height='20' align='center'><img src='images/topopen.gif' width='19' height='20'></td><td colspan='2' width='*' class='optextb'>" + Tstrg + "</td></tr></table>";
  753. }
  754.  
  755. // Process Click on Group in Group Tree 
  756. var CurExpGroupIx = null; // Index to Current Expanded Group
  757. var CurCmpIx = 0;
  758. var CmpsExpected = 0;
  759. var CSortArr = new Array();
  760. var EOBj = null;
  761. function procGrpImgClick(SIm) {
  762.     isx = SIm.id;  
  763.     if ( isx.charAt(0) != "l" ) { // if not a "limaxx"
  764.         top.banner.beep();
  765.         return;
  766.     }
  767.     var cx = isx.substring(4,isx.length); // Strip off index
  768.  
  769.     CurExpGroupIx = parseInt(cx,10);
  770.     CObj = document.all["lima"+cx];
  771.     EObj = document.all["lexp"+cx];
  772.     FObj = document.all["limb"+cx];
  773.     Cpfx = (CurExpGroupIx == LastGroupDisplayed) ? "L" : "T";
  774.  
  775.     if ( CObj.expanded == "1" ) { // if currently expanded
  776.         FObj.src = "images/CloseImg.gif";
  777.         CObj.src = "images/" + Cpfx + "plus.gif";
  778.         EObj.style.display = "none";
  779.        CObj.expanded = "0"; // Set contracted
  780.        GroupExpandedCount -= EObj.compcount; // decrement count of open computers
  781.      }
  782.     else { // otherwise Expand
  783.         FObj.src = "images/OpenImg.gif";
  784.         CCEs = ""; // initialize
  785.         CObj.src = "images/" + Cpfx + "minus.gif";
  786.           CObj.expanded = "1"; // Set expanded
  787.           if ( EObj.compcount == 0 ) {
  788.               CmpsExpected = CurCmpIx = 0; // initialize
  789.               var AGID = AlertRec_Arr[(EObj.agix*AlertRecLength)]; // get Alert Group ID
  790.               var AGType = AlertRec_Arr[(EObj.agix*AlertRecLength)+3]; // get Alert Group Type
  791.               // Add Computers to the Tree for This Alert Group 
  792.               CSortArr.length = 0; // reset
  793.               switch ( AGType ) {
  794.                case "S" : 
  795.                       // Find each service that matches Alert Group ID
  796.                     for ( var i=0; i<Services_Arr.length; i+= ServicesRecLength ) {
  797.                         if ( Services_Arr[i+1] == AGID ) {
  798.                             // Get computer ID from Service entry
  799.                            for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) {
  800.                                // if match on Computer ID
  801.                                 if ( Services_Arr[i] == AC_CompStoreArr[j] ) {                   
  802.                                     CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j;
  803.                                     break;
  804.                                 }
  805.                             }
  806.                         }
  807.                     }
  808.                   break;
  809.                case "L" : 
  810.                   // Find each Syslog Check that matches Alert Group ID
  811.                     for ( var i=0; i<SyslogCheck_Arr.length; i+= SyslogCheckRecLength ) {
  812.                         if ( SyslogCheck_Arr[i+1] == AGID ) {
  813.                             // Get computer ID from entry
  814.                            for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) {
  815.                                // if match on Computer ID
  816.                                 if ( SyslogCheck_Arr[i] == AC_CompStoreArr[j] ) {                   
  817.                                     CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j;
  818.                                     break;
  819.                                 }
  820.                             }
  821.                         }
  822.                     }
  823.                   break;
  824.                case "F" : 
  825.                   // Find each File Check that matches Alert Group ID
  826.                     for ( var i=0; i<FileCheck_Arr.length; i+= FileCheckRecLength ) {
  827.                         if ( FileCheck_Arr[i+1] == AGID ) {
  828.                             // Get computer ID from entry
  829.                            for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) {
  830.                                // if match on Computer ID
  831.                                 if ( FileCheck_Arr[i] == AC_CompStoreArr[j] ) {                   
  832.                                     CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j;
  833.                                     break;
  834.                                 }
  835.                             }
  836.                         }
  837.                     }
  838.                   break;
  839.                 case "P" : 
  840.                   // Find each Process Check that matches Alert Group ID
  841.                     for ( var i=0; i<ProcessCheck_Arr.length; i+= ProcessCheckRecLength ) {
  842.                         if ( ProcessCheck_Arr[i+1] == AGID ) {
  843.                             // Get computer ID from entry
  844.                            for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) {
  845.                                // if match on Computer ID
  846.                                 if ( ProcessCheck_Arr[i] == AC_CompStoreArr[j] ) {                   
  847.                                     CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j;
  848.                                     break;
  849.                                 }
  850.                             }
  851.                         }
  852.                     }
  853.                   break;                
  854.                 case "W" : 
  855.                   // Find each WinService Check that matches Alert Group ID
  856.                     for ( var i=0; i<WinSCheck_Arr.length; i+= WinSCheckRecLength ) {
  857.                         if ( WinSCheck_Arr[i+1] == AGID ) {
  858.                             // Get computer ID from entry
  859.                            for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) {
  860.                                // if match on Computer ID
  861.                                 if ( WinSCheck_Arr[i] == AC_CompStoreArr[j] ) {                   
  862.                                     CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j;
  863.                                     break;
  864.                                 }
  865.                             }
  866.                         }
  867.                     }
  868.                   break;
  869.                case "T" : 
  870.                   // Find each SNMPTRap Check that matches Alert Group ID
  871.                     for ( var i=0; i<SNMPCheck_Arr.length; i+= SNMPCheckRecLength ) {
  872.                         if ( SNMPCheck_Arr[i+1] == AGID ) {
  873.                             // Get computer ID from entry
  874.                            for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) {
  875.                                // if match on Computer ID
  876.                                 if ( SNMPCheck_Arr[i] == AC_CompStoreArr[j] ) {                   
  877.                                     CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j;
  878.                                     break;
  879.                                 }
  880.                             }
  881.                         }
  882.                     }
  883.                   break;
  884.                case "E" : 
  885.                   // Find each EventLog Check that matches Alert Group ID
  886.                     for ( var i=0; i<EventLCheck_Arr.length; i+= EventLCheckRecLength ) {
  887.                         if ( EventLCheck_Arr[i+1] == AGID ) {
  888.                             // Get computer ID from entry
  889.                            for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) {
  890.                                // if match on Computer ID
  891.                                 if ( EventLCheck_Arr[i] == AC_CompStoreArr[j] ) {                   
  892.                                     CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j;
  893.                                     break;
  894.                                 }
  895.                             }
  896.                         }
  897.                     }
  898.                   break;
  899.             }        
  900.             CSortArr.sort();
  901.             var warr = new Array();
  902.             for ( var i=0, j=0; i<CmpsExpected; i++ ) {
  903.                 warr = CSortArr[i].split("~");
  904.                 j = parseInt(warr[1],10);
  905.                 processTreeComputer(j,AGID,AGType);
  906.             }
  907.     
  908.             var lindx = CCEs.lastIndexOf("T.gif");
  909.             if ( lindx != -1 ) {
  910.                 var eCCE = CCEs.substring(0, lindx);
  911.                 eCCE += "L";
  912.                 eCCE += CCEs.substring(lindx+1)
  913.                 CCEs = eCCE;
  914.             }
  915.             EObj.compcount = CmpsExpected; // set number computers opened
  916.             EObj.insertAdjacentHTML("beforeEnd",CCEs);
  917.          }
  918.           GroupExpandedCount += EObj.compcount; // increment total number of computers opened
  919.         EObj.style.display = "";
  920.         CObj.scrollIntoView(true);
  921.     }
  922.     // enable SelectAll/UnselectAll buttons if computers opened
  923.     checkSelUnselButtons();
  924. }
  925.  
  926. function processTreeComputer(CSIx,AGID,AGType) {
  927.     var CmpID = AC_CompStoreArr[CSIx];
  928.     var CmpNme = AC_CompStoreArr[CSIx+2];
  929.     var CmpDesc = AC_CompStoreArr[CSIx+3];
  930.     var SState = AC_CompStoreArr[CSIx+4];
  931.     var Opfx = (CurExpGroupIx == LastGroupDisplayed) ? "White" : "I";
  932.     var Mpfx = "T";
  933.     
  934.     CCEs += "<table border='0' cellpadding='0' cellSpacing='0' width='490'>";
  935.     CCEs += "<tr><td width='25'> </td><td width='19' height='20' align='center'><img src='images/" + Opfx + ".gif' width='19' height='20'></td>";
  936.     CCEs += "<td width='19' height='20' align='center'><img src='images/" + Mpfx + ".gif' width='19' height='20'></td>";
  937.       CCEs += "<td width='11' align='center'><img id='xima" + CurExpGroupIx + "_" + CurCmpIx;
  938.  
  939.     //if ( SState == "1" ) {
  940.     //    CCEs +=  "' checked='1' src='images/"; 
  941.    //    CCEs +=  "Checked.gif' width='9' height='9'"; 
  942.     //    CmpImg = "sAdminServers.gif"; 
  943.     //}
  944.     //else {
  945.         CCEs +=  "' checked='0' src='images/"; 
  946.           CCEs += "Unchecked.gif' width='9' height='9'";
  947.           CmpImg = "Computer.gif";
  948.     //}
  949.         
  950.       CCEs += " compix='" +CSIx+"' cmpid='"+CmpID+"' agid='"+AGID+"' agt='"+AGType+"' style='cursor:hand' onclick='procELCmpImgClick(this)'></td>";
  951.     CCEs += "<td width='19' align='center'><img id='zimb" + CurExpGroupIx + "_" + CurCmpIx + "' src='images/"+CmpImg+"' style='cursor:hand' onclick='procELCmpImgClick(this)' width='15' height='16' title='";
  952.     CCEs += CmpDesc + "'></td>";
  953.     CCEs += "<td width='*' id='zimc" + CurExpGroupIx + "_" + CurCmpIx;
  954.     CCEs += "' style='cursor:hand' onclick='procELCmpImgClick(this)' class='optext'>" + CmpNme + "</td>";
  955.     CCEs += "</tr></table>";
  956.     ++CurCmpIx; // bump index
  957. }
  958.  
  959. function SetButtonState(BtObj,BState) {
  960.     //BtObj.className = (BState == "0") ? "BoxButton" : "BoxButtonD";
  961.     BtObj.disabled = (BState == "0") ? "" : "disabled";
  962.     BtObj.bdis = BState;
  963. }
  964.  
  965. /* Process Click to Check or Uncheck a Computer */
  966. function procELCmpImgClick(CmpIm) {
  967.     var isx = CmpIm.id;  
  968.     if ( isx.charAt(0) != "x" && isx.charAt(0) != "z") 
  969.                 return;
  970.     var cx = isx.substring(4,isx.length); // Strip off index
  971.     lx = cx.lastIndexOf("_"); // derive suffix to the Computer DIV ID
  972.     var dx = cx.substring(0,lx);
  973.  
  974.     var CObj = document.all["xima"+cx]; // Clicked Computer Entry
  975.     var FObj = document.all["zimb"+cx]; 
  976.     CSIx = parseInt(CObj.compix,10);
  977.  
  978.     if ( CObj.checked == "1" ) { // if currently Checked, Uncheck
  979.         FObj.src = "images/Computer.gif";
  980.         CObj.src = "images/Unchecked.gif";
  981.           CObj.checked = "0"; // Set Unchecked
  982.           AC_CompStoreArr[CSIx+4] = "0";
  983.       }
  984.     else { // otherwise Check
  985.         FObj.src = "images/sAdminServers.gif"; 
  986.         CObj.src = "images/Checked.gif";
  987.           CObj.checked = "1"; // Set Checked
  988.           AC_CompStoreArr[CSIx+4] = "1";
  989.     }
  990. }
  991.  
  992. // Process SelectALL or UnselectALL
  993. function processSelect(Pflg) {
  994.     var GObj = null, CObj = null;
  995.     // Look for each open/expanded Group
  996.     for ( var i=0; i<GroupDisplayedCount; i++ ) {
  997.         GObj = document.all["lima"+i];
  998.         if ( GObj.expanded == "1" ) {
  999.             GObj = document.all["lexp"+i];
  1000.             // if Group expanded, process each computer
  1001.             for ( var j=0; j<GObj.compcount; j++ ) {
  1002.                 CObj = document.all["xima"+i+"_"+j]; // computer entry in tree
  1003.                 if (CObj.checked == Pflg) {
  1004.                     procELCmpImgClick(CObj); // go process
  1005.                 }
  1006.             }
  1007.         }
  1008.     }
  1009. }
  1010.  
  1011.  
  1012.